
import React,{Component,Fragment}from "react";

class Demo extends Component {
    render () {
        return (
            <div>
                1111
            </div>
        )
    }
}

// 高阶函数
function AppWrapper (config={}) {
    return function (Component) {
        let old_render = Component.prototype.render
        Component.prototype.render = function () {
            // let {} = this.state.config
            return (
                <Fragment>
                     <div>装饰器头</div>
                     {old_render()}
                     <div>装饰器尾</div>
                </Fragment>
               
            )
        }
        return Component
    }
}
export default AppWrapper()(Demo)